Counting Magic Squares in Quasi-polynomial Time
نویسندگان
چکیده
We present a randomized algorithm, which, given positive integers n and t and a real number 0 < < 1, computes the number |Σ(n, t)| of n× n non-negative integer matrices (magic squares) with the row and column sums equal to t within relative error . The computational complexity of the algorithm is polynomial in −1 and quasi-polynomial in N = nt, that is, of the order N log N . A simplified version of the algorithm works in time polynomial in −1 and N and estimates |Σ(n, t)| within a factor of N log N . This simplified version has been implemented. We present results of the implementation, state some conjectures, and discuss possible generalizations.
منابع مشابه
An Enumerative Geometry for Magic and Magilatin Labellings
A magic labelling of a set system is a labelling of its points by distinct positive integers so that every set of the system has the same sum, the magic sum. Examples are magic squares (the sets are the rows, columns, and diagonals) and semimagic squares (the same, but without the diagonals). A magilatin labelling is like a magic labelling but the values need be distinct only within each set. W...
متن کاملOn the Geometry of Graph Arrangements
We use the results of [5], [6] to discuss the counting formulas of network flow polytopes and magic squares, i.e. the formula for the corresponding Ehrhart polynomial in terms of residues. We also discuss a description of the big cells using the theory of non broken circuit bases.
متن کاملRandom Matrices, Magic Squares and Matching Polynomials
Characteristic polynomials of random unitary matrices have been intensively studied in recent years: by number theorists in connection with Riemann zetafunction, and by theoretical physicists in connection with Quantum Chaos. In particular, Haake and collaborators have computed the variance of the coefficients of these polynomials and raised the question of computing the higher moments. The ans...
متن کاملA ug 2 00 9 ENUMERATION OF 4 × 4 MAGIC SQUARES
A magic square is an n × n array of distinct positive integers whose sum along any row, column, or main diagonal is the same number. We compute the number of such squares for n = 4, as a function of either the magic sum or an upper bound on the entries. The previous record for both functions was the n = 3 case. Our methods are based on inside-out polytopes, i.e., the combination of hyperplane a...
متن کاملJ an 2 00 5 The Number of “ Magic ” Squares , Cubes , and Hypercubes 1
Magic squares have turned up throughout history, some in a mathematical context, others in philosophical or religious contexts. According to legend, the first magic square was discovered in China by an unknown mathematician sometime before the first century A.D. It was a magic square of order three thought to have appeared on the back of a turtle emerging from a river. Other magic squares surfa...
متن کامل